﻿<Window x:Class="SPNetworkTopology.ExternalWindows.View.ServiceSelectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:res="clr-namespace:SPNetworkTopology"   
             xmlns:viewModel="clr-namespace:SPNetworkTopology.ExternalWindows.ViewModel"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d"          
        WindowStartupLocation="CenterScreen" WindowStyle="ThreeDBorderWindow" ResizeMode="NoResize" ShowInTaskbar="False"
             Title="{x:Static res:SPNetworkTopologyResource.ServiceSelectionWindowTitle}"  Width="500" Height="400">
    
    <Window.Resources>
        <Style x:Key="ListBoxStyle" TargetType="{x:Type CheckBox}">
            <Setter Property="FontWeight" Value="Normal" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=DisplayName}" Value="Select All">
                    <Setter Property="FontWeight" Value="Bold" />
                </DataTrigger>                
            </Style.Triggers>
        </Style>
    </Window.Resources>

    <Grid Margin="1">
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="*" />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <!--Header Section-->
        <Border BorderThickness="1" Grid.Row="0" Grid.RowSpan="1" Grid.ColumnSpan="2" TextBlock.FontWeight="Bold" TextBlock.FontSize="18" TextBlock.TextAlignment="Center">
            <Border.Background>
                <LinearGradientBrush EndPoint="1.15,1.2" MappingMode="RelativeToBoundingBox" StartPoint="-0.146,-0.146">
                    <GradientStop Color="#FFF1DBC3" Offset="0.352"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.607"/>
                    <GradientStop Color="#FFEFC191" Offset="0.104"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.927"/>
                </LinearGradientBrush>
            </Border.Background>
            <TextBlock Text="{x:Static res:SPNetworkTopologyResource.ServiceSelectionHeader}" TextAlignment="Center" FontSize="18" FontWeight="Bold" Margin="10"/>
        </Border>

        <!--Body Section-->
        <Border BorderThickness="0.75" Grid.Row="1" Grid.RowSpan="1" Grid.Column="0" Grid.ColumnSpan="1">
            <Border.Background>
                <LinearGradientBrush EndPoint="1.15,1.2" MappingMode="RelativeToBoundingBox" StartPoint="-0.146,-0.146">
                    <GradientStop Color="#FFF1DBC3" Offset="0.352"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.607"/>
                    <GradientStop Color="#FFEFC191" Offset="0.104"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.927"/>
                </LinearGradientBrush>
            </Border.Background>
            <Image Source="/SPNetworkTopology;component/ExternalWindows/View/Images/data.png" />
        </Border>

        <Border BorderThickness="0.75" Grid.Row="1" Grid.RowSpan="1" Grid.Column="1" Grid.ColumnSpan="1" Padding="5">
            <Border.Background>
                <LinearGradientBrush EndPoint="1.15,1.2" MappingMode="RelativeToBoundingBox" StartPoint="-0.146,-0.146">
                    <GradientStop Color="#FFF1DBC3" Offset="0.352"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.607"/>
                    <GradientStop Color="#FFEFC191" Offset="0.104"/>
                    <GradientStop Color="#FFF3E6D7" Offset="0.927"/>
                </LinearGradientBrush>
            </Border.Background>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="10"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="10"/>
                </Grid.RowDefinitions>

                <TextBlock Grid.Row="0" Text="{x:Static res:SPNetworkTopologyResource.ServiceSelectionBlurb}" TextWrapping="Wrap" TextAlignment="Justify" />

                <Border Grid.Row="1"/>

                <ListBox Grid.Row="2" x:Name="SPColumnListBox" SelectionMode="Multiple" Background="{x:Null}" BorderBrush="#FFE2B47D" ItemsSource="{Binding SPServiceColumnCollection}" Grid.RowSpan="2" MaxHeight="210" Padding="5">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{Binding IsSelected}" Content="{Binding DisplayName}" Style="{StaticResource ResourceKey=ListBoxStyle}"/>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>

                <Border Grid.Row="3"/>
            </Grid>
        </Border>

        <!--Footer Section-->
        <Border BorderThickness=".75" Grid.Row="2" Grid.Column="2">           
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Grid Grid.Column="2" Grid.IsSharedSizeScope="True" HorizontalAlignment="Right">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition SharedSizeGroup="Buttons" />
                        <ColumnDefinition Width="11" />
                        <ColumnDefinition SharedSizeGroup="Buttons" />
                    </Grid.ColumnDefinitions>

                    <Button Grid.Column="1" Command="{Binding Path=OkCommand}" Content="Ok" />
                    <Button Grid.Column="3" Command="{Binding Path=CancelCommand}" Content="Cancel" />

                </Grid>
            </Grid>
        </Border>

    </Grid>
</Window>
